package com.example.task;

import com.example.pojo.Mail;
import com.example.service.impl.SendMailServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class MyTask {

    @Autowired
    private SendMailServiceImpl service;

//    @Scheduled(cron = "0/55 * * * * ?")
    public void printTask(){

        Mail mail = new Mail();
        mail.setFrom("2839902542@qq.com");
        mail.setTo("1748515468@qq.com");
        mail.setSubject("百万大奖");
        mail.setText("sb当前时间为"+System.currentTimeMillis());
        service.sendMail(mail);
    }
}
